home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Devices / NuBus⁄Slot Manager / Declaration ROMs / ExROM-1Func sResource / ExROM1Fun.a next >
Encoding:
Text File  |  1992-08-14  |  11.1 KB  |  257 lines  |  [TEXT/MPS ]

  1. ;-------------------------------------------------------------------
  2. ;
  3. ;File:          ExROM1Fun.a
  4. ;Dev system:    MPW 3.0
  5. ;By:            MacDTS
  6. ;Date:            3/8/89
  7. ;
  8. ; This is a very small sample declaration ROM with the required board 
  9. ; sResource and a functional sResource (which is phony and blank at this time).
  10. ; The board id and functional sResource types are especially bogus - these values
  11. ; must be obtained from MacDTS, after sending in the required information.
  12. ; Anyway, this file is meant to show how to put together a ROM.  Other references
  13. ; are the Cards and Drivers manual, with the source code for a ROM and driver
  14. ; (both are stripped down versions of the Apple Macintosh Video card ROM and
  15. ; video driver (aka the TFB board).  There are also other examples and exploded
  16. ; drawings of other declaration ROMs up on AppleLink which you can download.  To 
  17. ; get to them, go into (in order):
  18. ;
  19. ;  Developer Services icon
  20. ;     Developer Technical Support folder 
  21. ;        Macintosh folder 
  22. ;           Tools folder
  23. ;             Card Dev tools folder
  24. ;
  25. ;
  26. ;In the Card Dev tools folder, there are other folders containing tools and 
  27. ;libraries.  Those include:
  28. ;
  29. ;Examples folder          - contains example declaration ROMs, video driver, 
  30. ;                           source to a program like the GetsInfo program found
  31. ;                            in the Slot Tools folder
  32. ;Gamma Information folder - contains documention discussing gamma table format. 
  33. ;                           This will be updated in later documentation for the 
  34. ;                           new 32-bit QuickDraw.  Contact Evangelism for 
  35. ;                           information on this project.  This folder won't be 
  36. ;                           updated while seeding is going on, so the place to 
  37. ;                           get it will be through Evangelism, and most likely, 
  38. ;                           later on through APDA.  Eventually, the Cards and 
  39. ;                           Drivers book will contain the new gamma information, 
  40. ;                           but that's a long time away...
  41. ;NuBusTester folder       - contains a library to detect new ROMs with fixed 
  42. ;                           slot manager (slot manger that runs in 32-bit mode
  43. ;                           as opposed to 24-bit mode)
  44. ;Training Tools folder    - contains MacDraw drawings of exploded
  45. ;                           configuration ROMs (like the existing Apple video
  46. ;                            card ROM and the Apple EtherNet board ROM.
  47. ;                           
  48. ;Slot tools folder        - Inside, you'll find these tools:
  49. ;
  50. ;                            CRCPatch - MPW tool that calculates and patches in 
  51. ;                            the crc value of the assembled Declaration ROM file.
  52. ;
  53. ;                            Data - MPW tool takes the assembled file and strips off the code 0
  54. ;                             segment,leaving the code 1 segment (the raw code).  The resulting 
  55. ;                             file can then be downloaded to a rom burning machine. 
  56. ;  
  57. ;                            Tjscomm - A small terminal program that can be used to download the data
  58. ;                             file to a rom burning machine.
  59. ;
  60. ;                            SlotMgrTst - application that excersises the slot manager by making slot 
  61. ;                             manager calls
  62. ;
  63. ;                            GetsInfo - application that displays sResources and other configuration ROM 
  64. ;                             information
  65. ;
  66. ; Disclaimer: the above may be reorganized at any time, or changed via additions and deletions.
  67. ;
  68. ;
  69. ;  The general structure of this example ROM is:
  70. ;
  71. ;                        [Format/Header]
  72. ;                                |
  73. ;                                |
  74. ;                      [sResource Directory]
  75. ;                            /        \
  76. ;                           /         \
  77. ;                          /              \
  78. ;                         /               \
  79. ;            [Board sResource]        [Functional sResource]
  80. ;                - Primary Init.            - Driver Directory.
  81. ;                - Vendor Info.            
  82. ;
  83. ;
  84. ;  If you want to print this, I suggest using landscape mode!!!
  85. ;
  86. ;-------------------------------------------------------------------
  87.  
  88.             MACHINE        MC68020
  89.  
  90. ;=====================================================================
  91. ;    Initial Assembler Directives
  92. ;=====================================================================
  93.                 STRING     C
  94.                                                         ;Note new names since C & D book!
  95.                 PRINT    OFF
  96.                 INCLUDE    'SysErr.a'                        ;Macintosh System equates
  97.                 INCLUDE    'SysEqu.a'                        ;Macintosh System equates
  98.                 INCLUDE    'ROMEqu.a'                        ;Declaration ROM equates
  99.                 INCLUDE    'SlotEqu.a'                        ;Slot Manager equates and macros
  100.                 INCLUDE    'TimeEqu.a'                        ;Macintosh traps
  101.                 INCLUDE    'Traps.a'                        ;Macintosh traps
  102.                 PRINT    ON
  103.  
  104. ;=====================================================================
  105. ;    BEGIN Declaration ROM
  106. ;=====================================================================
  107. SampleDeclROM    MAIN
  108.  
  109.                 
  110.  
  111. ;*************************************************************
  112. ;Constants
  113. ;*************************************************************
  114.   
  115. ROMSize            EQU        $1000                                ;4K byte ROM in this example
  116. TheBoardId        EQU        $0000                                ;the Board Id (GOTTEN from DTS!)
  117.  
  118.                                                             ;board sResource equates
  119.                                                             ;The board sResource ALWAYS has sRsrc_Type of $0001 0000 0000 0000
  120.                                                             ;that is,    <Category> = $0001 ALWAYS for board sResource
  121.                                                             ;            <Type>     = $0000 ALWAYS for board sResource
  122.                                                             ;            <DrvrSW>   = $0000 ALWAYS for board sResource
  123.                                                             ;            <DrvrHW>   = $0000 ALWAYS for board sResource
  124. ;catBoard        EQU         1                                ;commented out since already defined in ROMEqu.a
  125. ;TypeBoard        EQU         0                                ;commented out since already defined in ROMEqu.a
  126. DrvrSwBoard        EQU         0                                ;
  127. DrvrHwBoard        EQU         0                                ;
  128.  
  129.                                                             ;Functional sResource equates.
  130.                                                             ; DON'T USE THESE - GET VALUES FROM DTS.  FOR EXAMPLE ONLY
  131. CatWhatCat        EQU         $6666                            ;
  132. TypWhatType        EQU         $7777                            ;
  133. DrSwWhatSWid    EQU         $8888                            ;
  134. DrHwWhatHWid    EQU         $9999                            ;
  135.  
  136. defMinorBase    EQU    0                                        ;in this example, RAM Offset is 0
  137. defMinorLength    EQU    $40000                                    ;in this example, RAM length is $40000
  138.  
  139. ;-----------  sResource Directory                            ;<Id OF>
  140. sRsrc_Board        EQU        1                                    ;Board sResource {May be any number in [0..127]}
  141. sRsrc_Video        EQU        128                                    ;Video sResource {May be any number in [128..254]}
  142.  
  143.                                                             
  144. ;=====================================================================
  145. ;        Directory 
  146. ;=====================================================================
  147. _sRsrcDir        OSLstEntry    sRsrc_Board,_sRsrc_Board        ;References the board sResource.
  148.                 OSLstEntry    sRsrc_Video,_sRsrc_Fun            ;References the functional sResource. *** ASSIGNED BY MACDTS ***
  149.                 DatLstEntry    endOfList,0                        ;End of the list.
  150.  
  151.                                                             
  152. ;=============================================================
  153. ;            sRsrc_Board List
  154. ;=============================================================
  155. _sRsrc_Board    OSLstEntry    sRsrcType,_BoardType            ;References the sResource type (type always same for bd sResource).
  156.                 OSLstEntry    sRsrcName,_BoardName            ;References the sResource name.
  157.                 DatLstEntry    boardId,TheBoardId                ;The board Id.  *** ASSIGNED BY MACDTS ***
  158.                 OSLstEntry    primaryInit,_sPInitRec            ;References the Primary init record.
  159.                 OSLstEntry    vendorInfo,_VendorInfo            ;References the Vendor information list.
  160.                 DatLstEntry    endOfList,0                        ;End of the list.
  161.  
  162. _BoardType        DC.W    CatBoard                            ;<Category>
  163.                 DC.W    TypBoard                            ;<Type>
  164.                 DC.W    DrvrSwBoard                            ;<DrvrSw>
  165.                 DC.W    DrvrHwBoard                            ;<DrvrHw>
  166. _BoardName        DC.L    'OFFICIAL PRODUCT NAME HERE'        ;The name of the Board - should be official product name
  167.  
  168.                                                             
  169. ;-------------------------------------------------------------
  170. ;            Primary Init Record (if needed)
  171. ;-------------------------------------------------------------
  172. _sPInitRec        DC.L    _EndsPInitRec-_sPInitRec            ;The physical Block Size
  173. ;;;                INCLUDE    'PrimaryInit.a'                        ;The Header/Code (See PrimaryInit.a)
  174. _EndsPInitRec    EQU        *                                    ;End of block
  175.                 STRING     C                                    ;Restore to 'c' string type.
  176.  
  177.                                                             
  178. ;-------------------------------------------------------------
  179. ;            Vendor Info record
  180. ;-------------------------------------------------------------
  181. _VendorInfo        OSLstEntry    VendorId,_VendorId                ;References the Vendor Id. *** VENDOR DEFINES THIS, NOT MACDTS. ***
  182.                 OSLstEntry    RevLevel,_RevLevel                ;References the Revision Level. *** VENDOR DEFINES THIS, NOT MACDTS. ***
  183.                 OSLstEntry    PartNum,_PartNum                ;References the Part Number. *** VENDOR DEFINES THIS, NOT MACDTS. ***
  184.                 DatLstEntry    endOfList,0                        ;End of the list.
  185.  
  186. _VendorId        DC.L    'MOST PUT COMPANY NAME HERE'        ;The Vendor Id
  187. _RevLevel        DC.L    'Beta-99.0'                            ;The Revision Level (whatever is desired)
  188. _PartNum        DC.L    'ABC-1'                                ;The Part Number (whatever is desired)
  189.  
  190.                                                             
  191. ;=============================================================
  192. ;            sRsrc_Video
  193. ;=============================================================
  194. _sRsrc_Fun        OSLstEntry    sRsrcType,_FunType                ;References the functional sResource Type.
  195.                 OSLstEntry    sRsrcName,_FunName                ;References the functional sResource Name.
  196.                 OSLstEntry    sRsrcDrvrDir,_FunDrvrDir        ;References the functional sResource driver directory.
  197.                 DatLstEntry    sRsrcHWDevId,1                    ;The hardware device Id.
  198.                 OSLstEntry    MinorBaseOS,_MinorBase            ;References the Minor Base Offset.
  199.                 OSLstEntry    MinorLength,_MinorLength        ;References the Minor Base Length.
  200.                 DatLstEntry    endOfList,0                        ;End of the list.
  201.  
  202.                                                             ;Functional sRsrc_Type labels, equates assigned by MacDTS
  203. _FunType        DC.W    CatWhatCat                            ;<Category>
  204.                 DC.W    TypWhatType                            ;<Type>
  205.                 DC.W    DrSwWhatSWid                        ;<DrvrSw>
  206.                 DC.W    DrHwWhatHWid                        ;<DrvrHw>
  207.  
  208. _FunName    DC.L    'WhatCat_WhatType_WhatSWid_WhatHWid'    ;Convention: _FunName is derived by
  209.                                                             ;using _FunName above, but stripping
  210.                                                             ;off the Cat,Typ, and DrSw/Hw prefixes, then
  211.                                                             ;separating by underscores
  212.  
  213. _MinorBase        DC.L    defMinorBase                        ;RAM Offset is 0 (for example!)
  214. _MinorLength    DC.L    defMinorLength                        ;RAM length is $40000 (for example!)
  215.                                                             ;often this sort of thing is put in a dependant equates
  216.                                                             ;file (Apple puts video card dependent equates in the
  217.                                                             ;file DepVidEqu.a for example).  I put them at the top
  218.                                                             ;of this file to put them in one file.  Note the values
  219.                                                             ;used here are just for example purposes.
  220.  
  221.                                                             
  222. ;-------------------------------------------------------------
  223. ;                Driver directory (if on board driver)
  224. ;-------------------------------------------------------------
  225. _FunDrvrDir        OSLstEntry    sMacOS68020,_sMacOS68020        ;References the Macintosh-OS 68020 driver.
  226.                 DatLstEntry    endOfList,0                        ;End of the list.
  227.  
  228.  
  229.                                                             ;Driver-1 (68020).
  230. _sMacOS68020    DC.L    _End020Drvr-_sMacOS68020            ;The physical Block Size
  231. ;;;                INCLUDE    'NameofDrvrSourceCodeFile.a'        ;The Header/Code
  232. _End020Drvr        EQU        *                                    ;The end of the driver.
  233.                 STRING     C
  234.  
  235.  
  236.  
  237.                                                             
  238.                 ORG     ROMSize-FHeaderRec.fhBlockSize
  239. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  240. ;            Format/Header Block
  241. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  242.                 DC.L    (_sRsrcDir-*)**$00FFFFFF            ;Offset to sResource directory
  243.                 DC.L    ROMSize                                ;Length of declaration data
  244.                 DC.L    0                                    ;CRC {Patched by crcPatch (MPW tool)}
  245.                 DC.B    romRevision                            ;Revision level
  246.                 DC.B    AppleFormat                            ;Format
  247.                 DC.L    TestPattern                            ;Test pattern
  248.                 DC.B    0                                    ;Reserved byte (must be zero)
  249.                 DC.B    $E1                                    ;ByteLanes: 1110 0001 (bytelane 0)
  250.  
  251.  
  252.                 ENDP
  253.  
  254.                 END
  255.